import styles from './pasture.less';
import { connect } from 'dva';
import router from 'umi/router';

function Pasture(props) {
  return (
    <div className={styles.container}>
      <section className={styles.fixContainer}>
        {props.pasture.menuData.map((menu, index) => (
          <div
            className={styles.fixItem}
            key={index}
            onClick={() => {
              router.push(menu.url);
            }}
          >
            <img src={menu.iconSrc} />
            <span>{menu.text}</span>
          </div>
        ))}
      </section>
    </div>
  );
}
export default connect(state => {
  return {
    pasture: state.pasture
  };
})(Pasture);
